Remove opacity-groups
authorAlexander Larsson <alexl@redhat.com>
Thu, 4 Jul 2013 11:41:00 +0000 (11:41 +0000)
committerMatthias Clasen <mclasen@redhat.com>
Sun, 6 Oct 2013 06:56:03 +0000 (02:56 -0400)
GtkWidget had a hack where if opacity is 0.999 we set up an opacity group when
rendering the widget. This is no longer needed in 3.10, and GtkStack doesn't
use it anymore.

GdStack is using it, so applications should be ported from GdStack to GtkStack
in 3.12.

https://bugzilla.gnome.org/show_bug.cgi?id=703603

gtk/gtkwidget.c

index 9adf3e4ba1765b57b8cc5489f695a53a4d885c4d..1f05c8baef776061daa1d6d5f65c6c5f0659b9e3 100644 (file)
@@ -460,8 +460,6 @@ struct _GtkWidgetPrivate
   /* SizeGroup related flags */
   guint have_size_groups      : 1;
 
-  guint opacity_group         : 1;
-
   guint8 alpha;
   guint8 user_alpha;
 
@@ -6584,7 +6582,6 @@ _gtk_widget_draw (GtkWidget *widget,
   cairo_save (cr);
 
   push_group =
-    widget->priv->opacity_group ||
     (widget->priv->alpha != 255 &&
      !gtk_widget_is_toplevel (widget));
 
@@ -14986,27 +14983,6 @@ gtk_widget_update_alpha (GtkWidget *widget)
     }
 }
 
-static void
-gtk_widget_set_has_opacity_group  (GtkWidget *widget,
-                                  gboolean has_opacity_group)
-{
-  GtkWidgetPrivate *priv;
-
-  g_return_if_fail (GTK_IS_WIDGET (widget));
-
-  priv = widget->priv;
-
-  has_opacity_group = !!has_opacity_group;
-
-  if (priv->opacity_group == has_opacity_group)
-    return;
-
-  priv->opacity_group = has_opacity_group;
-
-  if (gtk_widget_get_realized (widget))
-    gtk_widget_queue_draw (widget);
-}
-
 /**
  * gtk_widget_set_opacity:
  * @widget: a #GtkWidget
@@ -15044,13 +15020,6 @@ gtk_widget_set_opacity  (GtkWidget *widget,
 
   alpha = round (opacity * 255);
 
-  /* As a kind of hack for internal use we treat an alpha very
-     close to 1.0 (rounds to 255) but not 1.0 as specifying that
-     we want the opacity group behaviour wrt draw handling, but
-     not actually an alpha value. See bug #687842 for discussions. */
-  gtk_widget_set_has_opacity_group (widget,
-                                   alpha == 255 && opacity != 1.0);
-
   if (alpha == priv->user_alpha)
     return;